home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Shareware / Programare / gpssdk / GPS.NET Global Positioning SDK 1.4.6.msi / Data1.cab / Form1.vb2 < prev    next >
Encoding:
Text File  |  2004-08-25  |  73.2 KB  |  1,606 lines

  1. ' *********************************************************************************************
  2. ' ***
  3. ' ***  GPS.NET for the PocketPC Example1
  4. ' ***  A Complete demonstration of GPS functionality
  5. ' ***
  6. ' ***  For help with your GPS device or programming questions, visit our support center:
  7. ' ***
  8. ' ***       http://www.gpsdotnet.Com/Support
  9. ' ***
  10. ' ***  Support can also be obtained by e-mailing us at:
  11. ' ***
  12. ' ***       support@gpsdotnet.Com
  13. ' ***
  14. ' ***  NOTE: This source code is considered public domain and may be re-used in your own
  15. ' ***        applications.
  16. ' ***
  17. ' *********************************************************************************************
  18.  
  19. Imports System.IO
  20. Imports System.Windows.Forms
  21. Imports StormSource.Gps
  22.  
  23. Public Class Form1
  24.     Inherits System.Windows.Forms.Form
  25.  
  26. #Region " Windows Form Designer generated code "
  27.  
  28.     Public Sub New()
  29.         MyBase.New()
  30.  
  31.         'This call is required by the Windows Form Designer.
  32.         InitializeComponent()
  33.  
  34.         'Add any initialization after the InitializeComponent() call
  35.  
  36.     End Sub
  37.  
  38.     'Form overrides dispose to clean up the Component list.
  39.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  40.         MyBase.Dispose(disposing)
  41.     End Sub
  42.  
  43.     'NOTE: The following procedure is required by the Windows Form Designer
  44.     'It can be modified using the Windows Form Designer.  
  45.     'Do not modify it using the code editor.
  46.     Friend WithEvents MenuComPort As System.Windows.Forms.MenuItem
  47.     Friend WithEvents LocalTimeTimer As System.Windows.Forms.Timer
  48.     Friend WithEvents MenuBaudRate As System.Windows.Forms.MenuItem
  49.     Friend WithEvents MenuBaudRate4800 As System.Windows.Forms.MenuItem
  50.     Friend WithEvents MenuBaudRate9600 As System.Windows.Forms.MenuItem
  51.     Friend WithEvents MenuDataBits As System.Windows.Forms.MenuItem
  52.     Friend WithEvents MenuDataBits8 As System.Windows.Forms.MenuItem
  53.     Friend WithEvents MenuDataBits7 As System.Windows.Forms.MenuItem
  54.     Friend WithEvents MenuParity As System.Windows.Forms.MenuItem
  55.     Friend WithEvents MenuParityNone As System.Windows.Forms.MenuItem
  56.     Friend WithEvents MenuParityEven As System.Windows.Forms.MenuItem
  57.     Friend WithEvents MenuParityOdd As System.Windows.Forms.MenuItem
  58.     Friend WithEvents MenuParitySpace As System.Windows.Forms.MenuItem
  59.     Friend WithEvents MenuParityMark As System.Windows.Forms.MenuItem
  60.     Friend WithEvents MenuStopBits As System.Windows.Forms.MenuItem
  61.     Friend WithEvents StatusBar As System.Windows.Forms.StatusBar
  62.     Friend WithEvents FixedSatellites As System.Windows.Forms.Label
  63.     Friend WithEvents TrackedSatellites As System.Windows.Forms.Label
  64.     Friend WithEvents ActiveSatellites As System.Windows.Forms.Label
  65.     Friend WithEvents FixedSatelliteCountLabel As System.Windows.Forms.Label
  66.     Friend WithEvents TrackedSatelliteCountLabel As System.Windows.Forms.Label
  67.     Friend WithEvents ActiveSatelliteCountLabel As System.Windows.Forms.Label
  68.     Friend WithEvents SatelliteList As System.Windows.Forms.ListView
  69.     Friend WithEvents PRCColumn As System.Windows.Forms.ColumnHeader
  70.     Friend WithEvents AzimuthColumn As System.Windows.Forms.ColumnHeader
  71.     Friend WithEvents ElevationColumn As System.Windows.Forms.ColumnHeader
  72.     Friend WithEvents MagneticVariation As System.Windows.Forms.Label
  73.     Friend WithEvents MagneticVariationLabel As System.Windows.Forms.Label
  74.     Friend WithEvents MeanDilutionOfPrecision As System.Windows.Forms.Label
  75.     Friend WithEvents VerticalDilutionOfPrecision As System.Windows.Forms.Label
  76.     Friend WithEvents HorizontalDilutionOfPrecision As System.Windows.Forms.Label
  77.     Friend WithEvents MeanDilutionOfPrecisionLabel As System.Windows.Forms.Label
  78.     Friend WithEvents VerticalDilutionOfPrecisionLabel As System.Windows.Forms.Label
  79.     Friend WithEvents HorizontalDilutionOfPrecisionLabel As System.Windows.Forms.Label
  80.     Friend WithEvents LocalTime As System.Windows.Forms.Label
  81.     Friend WithEvents UTCDateTime As System.Windows.Forms.Label
  82.     Friend WithEvents Longitude As System.Windows.Forms.Label
  83.     Friend WithEvents Latitude As System.Windows.Forms.Label
  84.     Friend WithEvents Direction As System.Windows.Forms.Label
  85.     Friend WithEvents DirectionLabel As System.Windows.Forms.Label
  86.     Friend WithEvents Bearing As System.Windows.Forms.Label
  87.     Friend WithEvents Speed As System.Windows.Forms.Label
  88.     Friend WithEvents LocalTimeLabel As System.Windows.Forms.Label
  89.     Friend WithEvents GPSTimeLabel As System.Windows.Forms.Label
  90.     Friend WithEvents BearingLabel As System.Windows.Forms.Label
  91.     Friend WithEvents LongitudeLabel As System.Windows.Forms.Label
  92.     Friend WithEvents LatitudeLabel As System.Windows.Forms.Label
  93.     Friend WithEvents SpeedLabel As System.Windows.Forms.Label
  94.     Friend WithEvents Altitude As System.Windows.Forms.Label
  95.     Friend WithEvents AltitudeLabel As System.Windows.Forms.Label
  96.     Friend WithEvents UnrecognizedSentences As System.Windows.Forms.ListBox
  97.     Friend WithEvents RecognizedSentences As System.Windows.Forms.ListBox
  98.     Friend WithEvents UnrecognizedSentencesLabel As System.Windows.Forms.Label
  99.     Friend WithEvents RecognizedSentencesLabel As System.Windows.Forms.Label
  100.     Friend WithEvents SatelliteTab As System.Windows.Forms.TabPage
  101.     Friend WithEvents RawDataTab As System.Windows.Forms.TabPage
  102.     Friend WithEvents LocationTab As System.Windows.Forms.TabPage
  103.     Friend WithEvents SignalColumn As System.Windows.Forms.ColumnHeader
  104.     Friend WithEvents TabControl As System.Windows.Forms.TabControl
  105.     Friend WithEvents MenuStopBits1 As System.Windows.Forms.MenuItem
  106.     Friend WithEvents MenuStopBits1_5 As System.Windows.Forms.MenuItem
  107.     Friend WithEvents MenuStopBits2 As System.Windows.Forms.MenuItem
  108.     Friend WithEvents GPSMenu As System.Windows.Forms.MenuItem
  109.     Friend WithEvents StartMenu As System.Windows.Forms.MenuItem
  110.     Friend WithEvents StopMenu As System.Windows.Forms.MenuItem
  111.     Friend WithEvents MainMenu As System.Windows.Forms.MainMenu
  112.     Friend WithEvents MenuComPort1 As System.Windows.Forms.MenuItem
  113.     Friend WithEvents MenuComPort2 As System.Windows.Forms.MenuItem
  114.     Friend WithEvents MenuComPort3 As System.Windows.Forms.MenuItem
  115.     Friend WithEvents MenuComPort4 As System.Windows.Forms.MenuItem
  116.     Friend WithEvents MenuComPort5 As System.Windows.Forms.MenuItem
  117.     Friend WithEvents MenuComPort6 As System.Windows.Forms.MenuItem
  118.     Friend WithEvents MenuComPort7 As System.Windows.Forms.MenuItem
  119.     Friend WithEvents MenuComPort8 As System.Windows.Forms.MenuItem
  120.     Friend WithEvents MenuComPortAutomatic As System.Windows.Forms.MenuItem
  121.     Friend WithEvents MenuBaudRateAutomatic As System.Windows.Forms.MenuItem
  122.     Friend WithEvents MenuSettings As System.Windows.Forms.MenuItem
  123.     Friend WithEvents MenuSeparator3 As System.Windows.Forms.MenuItem
  124.     Friend WithEvents MenuSeaprator2 As System.Windows.Forms.MenuItem
  125.     Friend WithEvents MenuSeparator1 As System.Windows.Forms.MenuItem
  126.     Private Sub InitializeComponent()
  127.         Dim ListViewItem1 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  128.         Dim ListViewSubItem1 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  129.         Dim ListViewSubItem2 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  130.         Dim ListViewSubItem3 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  131.         Dim ListViewSubItem4 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  132.         Dim ListViewItem2 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  133.         Dim ListViewSubItem5 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  134.         Dim ListViewSubItem6 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  135.         Dim ListViewSubItem7 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  136.         Dim ListViewSubItem8 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  137.         Dim ListViewItem3 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  138.         Dim ListViewSubItem9 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  139.         Dim ListViewSubItem10 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  140.         Dim ListViewSubItem11 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  141.         Dim ListViewSubItem12 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  142.         Dim ListViewItem4 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  143.         Dim ListViewSubItem13 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  144.         Dim ListViewSubItem14 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  145.         Dim ListViewSubItem15 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  146.         Dim ListViewSubItem16 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  147.         Dim ListViewItem5 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  148.         Dim ListViewSubItem17 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  149.         Dim ListViewSubItem18 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  150.         Dim ListViewSubItem19 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  151.         Dim ListViewSubItem20 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  152.         Dim ListViewItem6 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  153.         Dim ListViewSubItem21 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  154.         Dim ListViewSubItem22 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  155.         Dim ListViewSubItem23 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  156.         Dim ListViewSubItem24 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  157.         Dim ListViewItem7 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  158.         Dim ListViewSubItem25 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  159.         Dim ListViewSubItem26 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  160.         Dim ListViewSubItem27 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  161.         Dim ListViewSubItem28 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  162.         Dim ListViewItem8 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  163.         Dim ListViewSubItem29 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  164.         Dim ListViewSubItem30 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  165.         Dim ListViewSubItem31 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  166.         Dim ListViewSubItem32 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  167.         Dim ListViewItem9 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  168.         Dim ListViewSubItem33 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  169.         Dim ListViewSubItem34 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  170.         Dim ListViewSubItem35 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  171.         Dim ListViewSubItem36 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  172.         Dim ListViewItem10 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  173.         Dim ListViewSubItem37 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  174.         Dim ListViewSubItem38 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  175.         Dim ListViewSubItem39 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  176.         Dim ListViewSubItem40 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  177.         Dim ListViewItem11 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  178.         Dim ListViewSubItem41 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  179.         Dim ListViewSubItem42 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  180.         Dim ListViewSubItem43 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  181.         Dim ListViewSubItem44 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  182.         Dim ListViewItem12 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  183.         Dim ListViewSubItem45 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  184.         Dim ListViewSubItem46 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  185.         Dim ListViewSubItem47 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  186.         Dim ListViewSubItem48 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  187.         Dim ListViewItem13 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  188.         Dim ListViewSubItem49 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  189.         Dim ListViewSubItem50 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  190.         Dim ListViewSubItem51 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  191.         Dim ListViewSubItem52 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  192.         Dim ListViewItem14 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  193.         Dim ListViewSubItem53 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  194.         Dim ListViewSubItem54 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  195.         Dim ListViewSubItem55 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  196.         Dim ListViewSubItem56 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  197.         Dim ListViewItem15 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  198.         Dim ListViewSubItem57 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  199.         Dim ListViewSubItem58 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  200.         Dim ListViewSubItem59 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  201.         Dim ListViewSubItem60 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  202.         Dim ListViewItem16 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem
  203.         Dim ListViewSubItem61 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  204.         Dim ListViewSubItem62 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  205.         Dim ListViewSubItem63 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  206.         Dim ListViewSubItem64 As System.Windows.Forms.ListViewItem.ListViewSubItem = New System.Windows.Forms.ListViewItem.ListViewSubItem
  207.         Me.MainMenu = New System.Windows.Forms.MainMenu
  208.         Me.GPSMenu = New System.Windows.Forms.MenuItem
  209.         Me.MenuSettings = New System.Windows.Forms.MenuItem
  210.         Me.MenuComPort = New System.Windows.Forms.MenuItem
  211.         Me.MenuComPortAutomatic = New System.Windows.Forms.MenuItem
  212.         Me.MenuSeparator3 = New System.Windows.Forms.MenuItem
  213.         Me.MenuComPort1 = New System.Windows.Forms.MenuItem
  214.         Me.MenuComPort2 = New System.Windows.Forms.MenuItem
  215.         Me.MenuComPort3 = New System.Windows.Forms.MenuItem
  216.         Me.MenuComPort4 = New System.Windows.Forms.MenuItem
  217.         Me.MenuComPort5 = New System.Windows.Forms.MenuItem
  218.         Me.MenuComPort6 = New System.Windows.Forms.MenuItem
  219.         Me.MenuComPort7 = New System.Windows.Forms.MenuItem
  220.         Me.MenuComPort8 = New System.Windows.Forms.MenuItem
  221.         Me.MenuBaudRate = New System.Windows.Forms.MenuItem
  222.         Me.MenuBaudRateAutomatic = New System.Windows.Forms.MenuItem
  223.         Me.MenuSeaprator2 = New System.Windows.Forms.MenuItem
  224.         Me.MenuBaudRate4800 = New System.Windows.Forms.MenuItem
  225.         Me.MenuBaudRate9600 = New System.Windows.Forms.MenuItem
  226.         Me.MenuDataBits = New System.Windows.Forms.MenuItem
  227.         Me.MenuDataBits8 = New System.Windows.Forms.MenuItem
  228.         Me.MenuDataBits7 = New System.Windows.Forms.MenuItem
  229.         Me.MenuStopBits = New System.Windows.Forms.MenuItem
  230.         Me.MenuStopBits1 = New System.Windows.Forms.MenuItem
  231.         Me.MenuStopBits1_5 = New System.Windows.Forms.MenuItem
  232.         Me.MenuStopBits2 = New System.Windows.Forms.MenuItem
  233.         Me.MenuParity = New System.Windows.Forms.MenuItem
  234.         Me.MenuParityNone = New System.Windows.Forms.MenuItem
  235.         Me.MenuParityEven = New System.Windows.Forms.MenuItem
  236.         Me.MenuParityOdd = New System.Windows.Forms.MenuItem
  237.         Me.MenuParitySpace = New System.Windows.Forms.MenuItem
  238.         Me.MenuParityMark = New System.Windows.Forms.MenuItem
  239.         Me.MenuSeparator1 = New System.Windows.Forms.MenuItem
  240.         Me.StartMenu = New System.Windows.Forms.MenuItem
  241.         Me.StopMenu = New System.Windows.Forms.MenuItem
  242.         Me.LocalTimeTimer = New System.Windows.Forms.Timer
  243.         Me.StatusBar = New System.Windows.Forms.StatusBar
  244.         Me.TabControl = New System.Windows.Forms.TabControl
  245.         Me.LocationTab = New System.Windows.Forms.TabPage
  246.         Me.MagneticVariation = New System.Windows.Forms.Label
  247.         Me.MagneticVariationLabel = New System.Windows.Forms.Label
  248.         Me.MeanDilutionOfPrecision = New System.Windows.Forms.Label
  249.         Me.VerticalDilutionOfPrecision = New System.Windows.Forms.Label
  250.         Me.HorizontalDilutionOfPrecision = New System.Windows.Forms.Label
  251.         Me.MeanDilutionOfPrecisionLabel = New System.Windows.Forms.Label
  252.         Me.VerticalDilutionOfPrecisionLabel = New System.Windows.Forms.Label
  253.         Me.HorizontalDilutionOfPrecisionLabel = New System.Windows.Forms.Label
  254.         Me.LocalTime = New System.Windows.Forms.Label
  255.         Me.UTCDateTime = New System.Windows.Forms.Label
  256.         Me.Longitude = New System.Windows.Forms.Label
  257.         Me.Latitude = New System.Windows.Forms.Label
  258.         Me.Direction = New System.Windows.Forms.Label
  259.         Me.DirectionLabel = New System.Windows.Forms.Label
  260.         Me.Bearing = New System.Windows.Forms.Label
  261.         Me.Speed = New System.Windows.Forms.Label
  262.         Me.LocalTimeLabel = New System.Windows.Forms.Label
  263.         Me.GPSTimeLabel = New System.Windows.Forms.Label
  264.         Me.BearingLabel = New System.Windows.Forms.Label
  265.         Me.LongitudeLabel = New System.Windows.Forms.Label
  266.         Me.LatitudeLabel = New System.Windows.Forms.Label
  267.         Me.SpeedLabel = New System.Windows.Forms.Label
  268.         Me.Altitude = New System.Windows.Forms.Label
  269.         Me.AltitudeLabel = New System.Windows.Forms.Label
  270.         Me.SatelliteTab = New System.Windows.Forms.TabPage
  271.         Me.FixedSatellites = New System.Windows.Forms.Label
  272.         Me.TrackedSatellites = New System.Windows.Forms.Label
  273.         Me.ActiveSatellites = New System.Windows.Forms.Label
  274.         Me.FixedSatelliteCountLabel = New System.Windows.Forms.Label
  275.         Me.TrackedSatelliteCountLabel = New System.Windows.Forms.Label
  276.         Me.ActiveSatelliteCountLabel = New System.Windows.Forms.Label
  277.         Me.SatelliteList = New System.Windows.Forms.ListView
  278.         Me.PRCColumn = New System.Windows.Forms.ColumnHeader
  279.         Me.AzimuthColumn = New System.Windows.Forms.ColumnHeader
  280.         Me.ElevationColumn = New System.Windows.Forms.ColumnHeader
  281.         Me.SignalColumn = New System.Windows.Forms.ColumnHeader
  282.         Me.RawDataTab = New System.Windows.Forms.TabPage
  283.         Me.UnrecognizedSentences = New System.Windows.Forms.ListBox
  284.         Me.RecognizedSentences = New System.Windows.Forms.ListBox
  285.         Me.UnrecognizedSentencesLabel = New System.Windows.Forms.Label
  286.         Me.RecognizedSentencesLabel = New System.Windows.Forms.Label
  287.         '
  288.         'MainMenu
  289.         '
  290.         Me.MainMenu.MenuItems.Add(Me.GPSMenu)
  291.         '
  292.         'GPSMenu
  293.         '
  294.         Me.GPSMenu.MenuItems.Add(Me.MenuSettings)
  295.         Me.GPSMenu.MenuItems.Add(Me.MenuSeparator1)
  296.         Me.GPSMenu.MenuItems.Add(Me.StartMenu)
  297.         Me.GPSMenu.MenuItems.Add(Me.StopMenu)
  298.         Me.GPSMenu.Text = "GPS"
  299.         '
  300.         'MenuSettings
  301.         '
  302.         Me.MenuSettings.MenuItems.Add(Me.MenuComPort)
  303.         Me.MenuSettings.MenuItems.Add(Me.MenuBaudRate)
  304.         Me.MenuSettings.MenuItems.Add(Me.MenuDataBits)
  305.         Me.MenuSettings.MenuItems.Add(Me.MenuStopBits)
  306.         Me.MenuSettings.MenuItems.Add(Me.MenuParity)
  307.         Me.MenuSettings.Text = "Settings"
  308.         '
  309.         'MenuComPort
  310.         '
  311.         Me.MenuComPort.MenuItems.Add(Me.MenuComPortAutomatic)
  312.         Me.MenuComPort.MenuItems.Add(Me.MenuSeparator3)
  313.         Me.MenuComPort.MenuItems.Add(Me.MenuComPort1)
  314.         Me.MenuComPort.MenuItems.Add(Me.MenuComPort2)
  315.         Me.MenuComPort.MenuItems.Add(Me.MenuComPort3)
  316.         Me.MenuComPort.MenuItems.Add(Me.MenuComPort4)
  317.         Me.MenuComPort.MenuItems.Add(Me.MenuComPort5)
  318.         Me.MenuComPort.MenuItems.Add(Me.MenuComPort6)
  319.         Me.MenuComPort.MenuItems.Add(Me.MenuComPort7)
  320.         Me.MenuComPort.MenuItems.Add(Me.MenuComPort8)
  321.         Me.MenuComPort.Text = "Com Port"
  322.         '
  323.         'MenuComPortAutomatic
  324.         '
  325.         Me.MenuComPortAutomatic.Text = "Automatic"
  326.         '
  327.         'MenuSeparator3
  328.         '
  329.         Me.MenuSeparator3.Text = "-"
  330.         '
  331.         'MenuComPort1
  332.         '
  333.         Me.MenuComPort1.Text = "Com1"
  334.         '
  335.         'MenuComPort2
  336.         '
  337.         Me.MenuComPort2.Text = "Com2"
  338.         '
  339.         'MenuComPort3
  340.         '
  341.         Me.MenuComPort3.Text = "Com3"
  342.         '
  343.         'MenuComPort4
  344.         '
  345.         Me.MenuComPort4.Text = "Com4"
  346.         '
  347.         'MenuComPort5
  348.         '
  349.         Me.MenuComPort5.Text = "Com5"
  350.         '
  351.         'MenuComPort6
  352.         '
  353.         Me.MenuComPort6.Text = "Com6"
  354.         '
  355.         'MenuComPort7
  356.         '
  357.         Me.MenuComPort7.Text = "Com7"
  358.         '
  359.         'MenuComPort8
  360.         '
  361.         Me.MenuComPort8.Text = "Com8"
  362.         '
  363.         'MenuBaudRate
  364.         '
  365.         Me.MenuBaudRate.MenuItems.Add(Me.MenuBaudRateAutomatic)
  366.         Me.MenuBaudRate.MenuItems.Add(Me.MenuSeaprator2)
  367.         Me.MenuBaudRate.MenuItems.Add(Me.MenuBaudRate4800)
  368.         Me.MenuBaudRate.MenuItems.Add(Me.MenuBaudRate9600)
  369.         Me.MenuBaudRate.Text = "Baud Rate"
  370.         '
  371.         'MenuBaudRateAutomatic
  372.         '
  373.         Me.MenuBaudRateAutomatic.Text = "Automatic"
  374.         '
  375.         'MenuSeaprator2
  376.         '
  377.         Me.MenuSeaprator2.Text = "-"
  378.         '
  379.         'MenuBaudRate4800
  380.         '
  381.         Me.MenuBaudRate4800.Text = "4800"
  382.         '
  383.         'MenuBaudRate9600
  384.         '
  385.         Me.MenuBaudRate9600.Text = "9600"
  386.         '
  387.         'MenuDataBits
  388.         '
  389.         Me.MenuDataBits.MenuItems.Add(Me.MenuDataBits8)
  390.         Me.MenuDataBits.MenuItems.Add(Me.MenuDataBits7)
  391.         Me.MenuDataBits.Text = "Data Bits"
  392.         '
  393.         'MenuDataBits8
  394.         '
  395.         Me.MenuDataBits8.Text = "8"
  396.         '
  397.         'MenuDataBits7
  398.         '
  399.         Me.MenuDataBits7.Text = "7"
  400.         '
  401.         'MenuStopBits
  402.         '
  403.         Me.MenuStopBits.MenuItems.Add(Me.MenuStopBits1)
  404.         Me.MenuStopBits.MenuItems.Add(Me.MenuStopBits1_5)
  405.         Me.MenuStopBits.MenuItems.Add(Me.MenuStopBits2)
  406.         Me.MenuStopBits.Text = "Stop Bits"
  407.         '
  408.         'MenuStopBits1
  409.         '
  410.         Me.MenuStopBits1.Text = "1"
  411.         '
  412.         'MenuStopBits1_5
  413.         '
  414.         Me.MenuStopBits1_5.Text = "1.5"
  415.         '
  416.         'MenuStopBits2
  417.         '
  418.         Me.MenuStopBits2.Text = "2"
  419.         '
  420.         'MenuParity
  421.         '
  422.         Me.MenuParity.MenuItems.Add(Me.MenuParityNone)
  423.         Me.MenuParity.MenuItems.Add(Me.MenuParityEven)
  424.         Me.MenuParity.MenuItems.Add(Me.MenuParityOdd)
  425.         Me.MenuParity.MenuItems.Add(Me.MenuParitySpace)
  426.         Me.MenuParity.MenuItems.Add(Me.MenuParityMark)
  427.         Me.MenuParity.Text = "Parity"
  428.         '
  429.         'MenuParityNone
  430.         '
  431.         Me.MenuParityNone.Text = "None"
  432.         '
  433.         'MenuParityEven
  434.         '
  435.         Me.MenuParityEven.Text = "Even"
  436.         '
  437.         'MenuParityOdd
  438.         '
  439.         Me.MenuParityOdd.Text = "Odd"
  440.         '
  441.         'MenuParitySpace
  442.         '
  443.         Me.MenuParitySpace.Text = "Space"
  444.         '
  445.         'MenuParityMark
  446.         '
  447.         Me.MenuParityMark.Text = "Mark"
  448.         '
  449.         'MenuSeparator1
  450.         '
  451.         Me.MenuSeparator1.Text = "-"
  452.         '
  453.         'StartMenu
  454.         '
  455.         Me.StartMenu.Text = "Start"
  456.         '
  457.         'StopMenu
  458.         '
  459.         Me.StopMenu.Enabled = False
  460.         Me.StopMenu.Text = "Stop"
  461.         '
  462.         'LocalTimeTimer
  463.         '
  464.         Me.LocalTimeTimer.Enabled = True
  465.         Me.LocalTimeTimer.Interval = 500
  466.         '
  467.         'StatusBar
  468.         '
  469.         Me.StatusBar.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  470.         Me.StatusBar.Location = New System.Drawing.Point(0, 248)
  471.         Me.StatusBar.Size = New System.Drawing.Size(249, 30)
  472.         Me.StatusBar.Text = "Ready."
  473.         '
  474.         'TabControl
  475.         '
  476.         Me.TabControl.Controls.Add(Me.LocationTab)
  477.         Me.TabControl.Controls.Add(Me.SatelliteTab)
  478.         Me.TabControl.Controls.Add(Me.RawDataTab)
  479.         Me.TabControl.SelectedIndex = 0
  480.         Me.TabControl.Size = New System.Drawing.Size(249, 246)
  481.         '
  482.         'LocationTab
  483.         '
  484.         Me.LocationTab.Controls.Add(Me.MagneticVariation)
  485.         Me.LocationTab.Controls.Add(Me.MagneticVariationLabel)
  486.         Me.LocationTab.Controls.Add(Me.MeanDilutionOfPrecision)
  487.         Me.LocationTab.Controls.Add(Me.VerticalDilutionOfPrecision)
  488.         Me.LocationTab.Controls.Add(Me.HorizontalDilutionOfPrecision)
  489.         Me.LocationTab.Controls.Add(Me.MeanDilutionOfPrecisionLabel)
  490.         Me.LocationTab.Controls.Add(Me.VerticalDilutionOfPrecisionLabel)
  491.         Me.LocationTab.Controls.Add(Me.HorizontalDilutionOfPrecisionLabel)
  492.         Me.LocationTab.Controls.Add(Me.LocalTime)
  493.         Me.LocationTab.Controls.Add(Me.UTCDateTime)
  494.         Me.LocationTab.Controls.Add(Me.Longitude)
  495.         Me.LocationTab.Controls.Add(Me.Latitude)
  496.         Me.LocationTab.Controls.Add(Me.Direction)
  497.         Me.LocationTab.Controls.Add(Me.DirectionLabel)
  498.         Me.LocationTab.Controls.Add(Me.Bearing)
  499.         Me.LocationTab.Controls.Add(Me.Speed)
  500.         Me.LocationTab.Controls.Add(Me.LocalTimeLabel)
  501.         Me.LocationTab.Controls.Add(Me.GPSTimeLabel)
  502.         Me.LocationTab.Controls.Add(Me.BearingLabel)
  503.         Me.LocationTab.Controls.Add(Me.LongitudeLabel)
  504.         Me.LocationTab.Controls.Add(Me.LatitudeLabel)
  505.         Me.LocationTab.Controls.Add(Me.SpeedLabel)
  506.         Me.LocationTab.Controls.Add(Me.Altitude)
  507.         Me.LocationTab.Controls.Add(Me.AltitudeLabel)
  508.         Me.LocationTab.Location = New System.Drawing.Point(4, 4)
  509.         Me.LocationTab.Size = New System.Drawing.Size(241, 220)
  510.         Me.LocationTab.Text = "Location"
  511.         '
  512.         'MagneticVariation
  513.         '
  514.         Me.MagneticVariation.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  515.         Me.MagneticVariation.Location = New System.Drawing.Point(102, 201)
  516.         Me.MagneticVariation.Size = New System.Drawing.Size(135, 15)
  517.         Me.MagneticVariation.Text = "..."
  518.         '
  519.         'MagneticVariationLabel
  520.         '
  521.         Me.MagneticVariationLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  522.         Me.MagneticVariationLabel.Location = New System.Drawing.Point(3, 201)
  523.         Me.MagneticVariationLabel.Size = New System.Drawing.Size(93, 15)
  524.         Me.MagneticVariationLabel.Text = "Magnetic Var.:"
  525.         '
  526.         'MeanDilutionOfPrecision
  527.         '
  528.         Me.MeanDilutionOfPrecision.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  529.         Me.MeanDilutionOfPrecision.Location = New System.Drawing.Point(102, 147)
  530.         Me.MeanDilutionOfPrecision.Size = New System.Drawing.Size(135, 15)
  531.         Me.MeanDilutionOfPrecision.Text = "..."
  532.         '
  533.         'VerticalDilutionOfPrecision
  534.         '
  535.         Me.VerticalDilutionOfPrecision.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  536.         Me.VerticalDilutionOfPrecision.Location = New System.Drawing.Point(102, 183)
  537.         Me.VerticalDilutionOfPrecision.Size = New System.Drawing.Size(135, 15)
  538.         Me.VerticalDilutionOfPrecision.Text = "..."
  539.         '
  540.         'HorizontalDilutionOfPrecision
  541.         '
  542.         Me.HorizontalDilutionOfPrecision.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  543.         Me.HorizontalDilutionOfPrecision.Location = New System.Drawing.Point(102, 165)
  544.         Me.HorizontalDilutionOfPrecision.Size = New System.Drawing.Size(135, 15)
  545.         Me.HorizontalDilutionOfPrecision.Text = "..."
  546.         '
  547.         'MeanDilutionOfPrecisionLabel
  548.         '
  549.         Me.MeanDilutionOfPrecisionLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  550.         Me.MeanDilutionOfPrecisionLabel.Location = New System.Drawing.Point(3, 147)
  551.         Me.MeanDilutionOfPrecisionLabel.Size = New System.Drawing.Size(93, 15)
  552.         Me.MeanDilutionOfPrecisionLabel.Text = "Position DOP:"
  553.         '
  554.         'VerticalDilutionOfPrecisionLabel
  555.         '
  556.         Me.VerticalDilutionOfPrecisionLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  557.         Me.VerticalDilutionOfPrecisionLabel.Location = New System.Drawing.Point(3, 183)
  558.         Me.VerticalDilutionOfPrecisionLabel.Size = New System.Drawing.Size(93, 15)
  559.         Me.VerticalDilutionOfPrecisionLabel.Text = "Vertical DOP:"
  560.         '
  561.         'HorizontalDilutionOfPrecisionLabel
  562.         '
  563.         Me.HorizontalDilutionOfPrecisionLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  564.         Me.HorizontalDilutionOfPrecisionLabel.Location = New System.Drawing.Point(3, 165)
  565.         Me.HorizontalDilutionOfPrecisionLabel.Size = New System.Drawing.Size(93, 15)
  566.         Me.HorizontalDilutionOfPrecisionLabel.Text = "Horizontal DOP:"
  567.         '
  568.         'LocalTime
  569.         '
  570.         Me.LocalTime.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  571.         Me.LocalTime.Location = New System.Drawing.Point(102, 129)
  572.         Me.LocalTime.Size = New System.Drawing.Size(135, 15)
  573.         Me.LocalTime.Text = "..."
  574.         '
  575.         'UTCDateTime
  576.         '
  577.         Me.UTCDateTime.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  578.         Me.UTCDateTime.Location = New System.Drawing.Point(102, 111)
  579.         Me.UTCDateTime.Size = New System.Drawing.Size(135, 15)
  580.         Me.UTCDateTime.Text = "..."
  581.         '
  582.         'Longitude
  583.         '
  584.         Me.Longitude.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  585.         Me.Longitude.Location = New System.Drawing.Point(102, 93)
  586.         Me.Longitude.Size = New System.Drawing.Size(135, 15)
  587.         Me.Longitude.Text = "..."
  588.         '
  589.         'Latitude
  590.         '
  591.         Me.Latitude.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  592.         Me.Latitude.Location = New System.Drawing.Point(102, 75)
  593.         Me.Latitude.Size = New System.Drawing.Size(135, 15)
  594.         Me.Latitude.Text = "..."
  595.         '
  596.         'Direction
  597.         '
  598.         Me.Direction.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  599.         Me.Direction.Location = New System.Drawing.Point(102, 57)
  600.         Me.Direction.Size = New System.Drawing.Size(135, 15)
  601.         Me.Direction.Text = "..."
  602.         '
  603.         'DirectionLabel
  604.         '
  605.         Me.DirectionLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  606.         Me.DirectionLabel.Location = New System.Drawing.Point(3, 57)
  607.         Me.DirectionLabel.Size = New System.Drawing.Size(93, 15)
  608.         Me.DirectionLabel.Text = "Direction:"
  609.         '
  610.         'Bearing
  611.         '
  612.         Me.Bearing.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  613.         Me.Bearing.Location = New System.Drawing.Point(102, 39)
  614.         Me.Bearing.Size = New System.Drawing.Size(135, 15)
  615.         Me.Bearing.Text = "..."
  616.         '
  617.         'Speed
  618.         '
  619.         Me.Speed.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  620.         Me.Speed.Location = New System.Drawing.Point(102, 21)
  621.         Me.Speed.Size = New System.Drawing.Size(135, 15)
  622.         Me.Speed.Text = "..."
  623.         '
  624.         'LocalTimeLabel
  625.         '
  626.         Me.LocalTimeLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  627.         Me.LocalTimeLabel.Location = New System.Drawing.Point(3, 129)
  628.         Me.LocalTimeLabel.Size = New System.Drawing.Size(93, 15)
  629.         Me.LocalTimeLabel.Text = "Local Time:"
  630.         '
  631.         'GPSTimeLabel
  632.         '
  633.         Me.GPSTimeLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  634.         Me.GPSTimeLabel.Location = New System.Drawing.Point(3, 111)
  635.         Me.GPSTimeLabel.Size = New System.Drawing.Size(93, 15)
  636.         Me.GPSTimeLabel.Text = "GPS Time:"
  637.         '
  638.         'BearingLabel
  639.         '
  640.         Me.BearingLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  641.         Me.BearingLabel.Location = New System.Drawing.Point(3, 39)
  642.         Me.BearingLabel.Size = New System.Drawing.Size(93, 15)
  643.         Me.BearingLabel.Text = "Bearing:"
  644.         '
  645.         'LongitudeLabel
  646.         '
  647.         Me.LongitudeLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  648.         Me.LongitudeLabel.Location = New System.Drawing.Point(3, 93)
  649.         Me.LongitudeLabel.Size = New System.Drawing.Size(93, 15)
  650.         Me.LongitudeLabel.Text = "Longitude:"
  651.         '
  652.         'LatitudeLabel
  653.         '
  654.         Me.LatitudeLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  655.         Me.LatitudeLabel.Location = New System.Drawing.Point(3, 75)
  656.         Me.LatitudeLabel.Size = New System.Drawing.Size(93, 15)
  657.         Me.LatitudeLabel.Text = "Latitude:"
  658.         '
  659.         'SpeedLabel
  660.         '
  661.         Me.SpeedLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  662.         Me.SpeedLabel.Location = New System.Drawing.Point(3, 21)
  663.         Me.SpeedLabel.Size = New System.Drawing.Size(93, 15)
  664.         Me.SpeedLabel.Text = "Speed:"
  665.         '
  666.         'Altitude
  667.         '
  668.         Me.Altitude.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  669.         Me.Altitude.Location = New System.Drawing.Point(102, 3)
  670.         Me.Altitude.Size = New System.Drawing.Size(135, 15)
  671.         Me.Altitude.Text = "..."
  672.         '
  673.         'AltitudeLabel
  674.         '
  675.         Me.AltitudeLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  676.         Me.AltitudeLabel.Location = New System.Drawing.Point(3, 3)
  677.         Me.AltitudeLabel.Size = New System.Drawing.Size(93, 15)
  678.         Me.AltitudeLabel.Text = "Altitude:"
  679.         '
  680.         'SatelliteTab
  681.         '
  682.         Me.SatelliteTab.Controls.Add(Me.FixedSatellites)
  683.         Me.SatelliteTab.Controls.Add(Me.TrackedSatellites)
  684.         Me.SatelliteTab.Controls.Add(Me.ActiveSatellites)
  685.         Me.SatelliteTab.Controls.Add(Me.FixedSatelliteCountLabel)
  686.         Me.SatelliteTab.Controls.Add(Me.TrackedSatelliteCountLabel)
  687.         Me.SatelliteTab.Controls.Add(Me.ActiveSatelliteCountLabel)
  688.         Me.SatelliteTab.Controls.Add(Me.SatelliteList)
  689.         Me.SatelliteTab.Location = New System.Drawing.Point(4, 4)
  690.         Me.SatelliteTab.Size = New System.Drawing.Size(241, 220)
  691.         Me.SatelliteTab.Text = "Satellites"
  692.         '
  693.         'FixedSatellites
  694.         '
  695.         Me.FixedSatellites.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  696.         Me.FixedSatellites.Location = New System.Drawing.Point(177, 3)
  697.         Me.FixedSatellites.Size = New System.Drawing.Size(45, 18)
  698.         Me.FixedSatellites.Text = "0"
  699.         '
  700.         'TrackedSatellites
  701.         '
  702.         Me.TrackedSatellites.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  703.         Me.TrackedSatellites.Location = New System.Drawing.Point(117, 3)
  704.         Me.TrackedSatellites.Size = New System.Drawing.Size(24, 18)
  705.         Me.TrackedSatellites.Text = "0"
  706.         '
  707.         'ActiveSatellites
  708.         '
  709.         Me.ActiveSatellites.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  710.         Me.ActiveSatellites.Location = New System.Drawing.Point(45, 3)
  711.         Me.ActiveSatellites.Size = New System.Drawing.Size(24, 18)
  712.         Me.ActiveSatellites.Text = "0"
  713.         '
  714.         'FixedSatelliteCountLabel
  715.         '
  716.         Me.FixedSatelliteCountLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  717.         Me.FixedSatelliteCountLabel.Location = New System.Drawing.Point(141, 3)
  718.         Me.FixedSatelliteCountLabel.Size = New System.Drawing.Size(36, 18)
  719.         Me.FixedSatelliteCountLabel.Text = "Fixed:"
  720.         '
  721.         'TrackedSatelliteCountLabel
  722.         '
  723.         Me.TrackedSatelliteCountLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  724.         Me.TrackedSatelliteCountLabel.Location = New System.Drawing.Point(69, 3)
  725.         Me.TrackedSatelliteCountLabel.Size = New System.Drawing.Size(48, 18)
  726.         Me.TrackedSatelliteCountLabel.Text = "Tracked:"
  727.         '
  728.         'ActiveSatelliteCountLabel
  729.         '
  730.         Me.ActiveSatelliteCountLabel.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
  731.         Me.ActiveSatelliteCountLabel.Location = New System.Drawing.Point(6, 3)
  732.         Me.ActiveSatelliteCountLabel.Size = New System.Drawing.Size(39, 18)
  733.         Me.ActiveSatelliteCountLabel.Text = "Active:"
  734.         '
  735.         'SatelliteList
  736.         '
  737.         Me.SatelliteList.CheckBoxes = True
  738.         Me.SatelliteList.Columns.Add(Me.PRCColumn)
  739.         Me.SatelliteList.Columns.Add(Me.AzimuthColumn)
  740.         Me.SatelliteList.Columns.Add(Me.ElevationColumn)
  741.         Me.SatelliteList.Columns.Add(Me.SignalColumn)
  742.         Me.SatelliteList.FullRowSelect = True
  743.         ListViewSubItem1.Text = ""
  744.         ListViewSubItem2.Text = ""
  745.         ListViewSubItem3.Text = ""
  746.         ListViewSubItem4.Text = ""
  747.         ListViewItem1.SubItems.Add(ListViewSubItem1)
  748.         ListViewItem1.SubItems.Add(ListViewSubItem2)
  749.         ListViewItem1.SubItems.Add(ListViewSubItem3)
  750.         ListViewItem1.SubItems.Add(ListViewSubItem4)
  751.         ListViewItem1.Text = ""
  752.         ListViewSubItem5.Text = ""
  753.         ListViewSubItem6.Text = ""
  754.         ListViewSubItem7.Text = ""
  755.         ListViewSubItem8.Text = ""
  756.         ListViewItem2.SubItems.Add(ListViewSubItem5)
  757.         ListViewItem2.SubItems.Add(ListViewSubItem6)
  758.         ListViewItem2.SubItems.Add(ListViewSubItem7)
  759.         ListViewItem2.SubItems.Add(ListViewSubItem8)
  760.         ListViewItem2.Text = ""
  761.         ListViewSubItem9.Text = ""
  762.         ListViewSubItem10.Text = ""
  763.         ListViewSubItem11.Text = ""
  764.         ListViewSubItem12.Text = ""
  765.         ListViewItem3.SubItems.Add(ListViewSubItem9)
  766.         ListViewItem3.SubItems.Add(ListViewSubItem10)
  767.         ListViewItem3.SubItems.Add(ListViewSubItem11)
  768.         ListViewItem3.SubItems.Add(ListViewSubItem12)
  769.         ListViewItem3.Text = ""
  770.         ListViewSubItem13.Text = ""
  771.         ListViewSubItem14.Text = ""
  772.         ListViewSubItem15.Text = ""
  773.         ListViewSubItem16.Text = ""
  774.         ListViewItem4.SubItems.Add(ListViewSubItem13)
  775.         ListViewItem4.SubItems.Add(ListViewSubItem14)
  776.         ListViewItem4.SubItems.Add(ListViewSubItem15)
  777.         ListViewItem4.SubItems.Add(ListViewSubItem16)
  778.         ListViewItem4.Text = ""
  779.         ListViewSubItem17.Text = ""
  780.         ListViewSubItem18.Text = ""
  781.         ListViewSubItem19.Text = ""
  782.         ListViewSubItem20.Text = ""
  783.         ListViewItem5.SubItems.Add(ListViewSubItem17)
  784.         ListViewItem5.SubItems.Add(ListViewSubItem18)
  785.         ListViewItem5.SubItems.Add(ListViewSubItem19)
  786.         ListViewItem5.SubItems.Add(ListViewSubItem20)
  787.         ListViewItem5.Text = ""
  788.         ListViewSubItem21.Text = ""
  789.         ListViewSubItem22.Text = ""
  790.         ListViewSubItem23.Text = ""
  791.         ListViewSubItem24.Text = ""
  792.         ListViewItem6.SubItems.Add(ListViewSubItem21)
  793.         ListViewItem6.SubItems.Add(ListViewSubItem22)
  794.         ListViewItem6.SubItems.Add(ListViewSubItem23)
  795.         ListViewItem6.SubItems.Add(ListViewSubItem24)
  796.         ListViewItem6.Text = ""
  797.         ListViewSubItem25.Text = ""
  798.         ListViewSubItem26.Text = ""
  799.         ListViewSubItem27.Text = ""
  800.         ListViewSubItem28.Text = ""
  801.         ListViewItem7.SubItems.Add(ListViewSubItem25)
  802.         ListViewItem7.SubItems.Add(ListViewSubItem26)
  803.         ListViewItem7.SubItems.Add(ListViewSubItem27)
  804.         ListViewItem7.SubItems.Add(ListViewSubItem28)
  805.         ListViewItem7.Text = ""
  806.         ListViewSubItem29.Text = ""
  807.         ListViewSubItem30.Text = ""
  808.         ListViewSubItem31.Text = ""
  809.         ListViewSubItem32.Text = ""
  810.         ListViewItem8.SubItems.Add(ListViewSubItem29)
  811.         ListViewItem8.SubItems.Add(ListViewSubItem30)
  812.         ListViewItem8.SubItems.Add(ListViewSubItem31)
  813.         ListViewItem8.SubItems.Add(ListViewSubItem32)
  814.         ListViewItem8.Text = ""
  815.         ListViewSubItem33.Text = ""
  816.         ListViewSubItem34.Text = ""
  817.         ListViewSubItem35.Text = ""
  818.         ListViewSubItem36.Text = ""
  819.         ListViewItem9.SubItems.Add(ListViewSubItem33)
  820.         ListViewItem9.SubItems.Add(ListViewSubItem34)
  821.         ListViewItem9.SubItems.Add(ListViewSubItem35)
  822.         ListViewItem9.SubItems.Add(ListViewSubItem36)
  823.         ListViewItem9.Text = ""
  824.         ListViewSubItem37.Text = ""
  825.         ListViewSubItem38.Text = ""
  826.         ListViewSubItem39.Text = ""
  827.         ListViewSubItem40.Text = ""
  828.         ListViewItem10.SubItems.Add(ListViewSubItem37)
  829.         ListViewItem10.SubItems.Add(ListViewSubItem38)
  830.         ListViewItem10.SubItems.Add(ListViewSubItem39)
  831.         ListViewItem10.SubItems.Add(ListViewSubItem40)
  832.         ListViewItem10.Text = ""
  833.         ListViewSubItem41.Text = ""
  834.         ListViewSubItem42.Text = ""
  835.         ListViewSubItem43.Text = ""
  836.         ListViewSubItem44.Text = ""
  837.         ListViewItem11.SubItems.Add(ListViewSubItem41)
  838.         ListViewItem11.SubItems.Add(ListViewSubItem42)
  839.         ListViewItem11.SubItems.Add(ListViewSubItem43)
  840.         ListViewItem11.SubItems.Add(ListViewSubItem44)
  841.         ListViewItem11.Text = ""
  842.         ListViewSubItem45.Text = ""
  843.         ListViewSubItem46.Text = ""
  844.         ListViewSubItem47.Text = ""
  845.         ListViewSubItem48.Text = ""
  846.         ListViewItem12.SubItems.Add(ListViewSubItem45)
  847.         ListViewItem12.SubItems.Add(ListViewSubItem46)
  848.         ListViewItem12.SubItems.Add(ListViewSubItem47)
  849.         ListViewItem12.SubItems.Add(ListViewSubItem48)
  850.         ListViewItem12.Text = ""
  851.         ListViewSubItem49.Text = ""
  852.         ListViewSubItem50.Text = ""
  853.         ListViewSubItem51.Text = ""
  854.         ListViewSubItem52.Text = ""
  855.         ListViewItem13.SubItems.Add(ListViewSubItem49)
  856.         ListViewItem13.SubItems.Add(ListViewSubItem50)
  857.         ListViewItem13.SubItems.Add(ListViewSubItem51)
  858.         ListViewItem13.SubItems.Add(ListViewSubItem52)
  859.         ListViewItem13.Text = ""
  860.         ListViewSubItem53.Text = ""
  861.         ListViewSubItem54.Text = ""
  862.         ListViewSubItem55.Text = ""
  863.         ListViewSubItem56.Text = ""
  864.         ListViewItem14.SubItems.Add(ListViewSubItem53)
  865.         ListViewItem14.SubItems.Add(ListViewSubItem54)
  866.         ListViewItem14.SubItems.Add(ListViewSubItem55)
  867.         ListViewItem14.SubItems.Add(ListViewSubItem56)
  868.         ListViewItem14.Text = ""
  869.         ListViewSubItem57.Text = ""
  870.         ListViewSubItem58.Text = ""
  871.         ListViewSubItem59.Text = ""
  872.         ListViewSubItem60.Text = ""
  873.         ListViewItem15.SubItems.Add(ListViewSubItem57)
  874.         ListViewItem15.SubItems.Add(ListViewSubItem58)
  875.         ListViewItem15.SubItems.Add(ListViewSubItem59)
  876.         ListViewItem15.SubItems.Add(ListViewSubItem60)
  877.         ListViewItem15.Text = ""
  878.         ListViewSubItem61.Text = ""
  879.         ListViewSubItem62.Text = ""
  880.         ListViewSubItem63.Text = ""
  881.         ListViewSubItem64.Text = ""
  882.         ListViewItem16.SubItems.Add(ListViewSubItem61)
  883.         ListViewItem16.SubItems.Add(ListViewSubItem62)
  884.         ListViewItem16.SubItems.Add(ListViewSubItem63)
  885.         ListViewItem16.SubItems.Add(ListViewSubItem64)
  886.         ListViewItem16.Text = ""
  887.         Me.SatelliteList.Items.Add(ListViewItem1)
  888.         Me.SatelliteList.Items.Add(ListViewItem2)
  889.         Me.SatelliteList.Items.Add(ListViewItem3)
  890.         Me.SatelliteList.Items.Add(ListViewItem4)
  891.         Me.SatelliteList.Items.Add(ListViewItem5)
  892.         Me.SatelliteList.Items.Add(ListViewItem6)
  893.         Me.SatelliteList.Items.Add(ListViewItem7)
  894.         Me.SatelliteList.Items.Add(ListViewItem8)
  895.         Me.SatelliteList.Items.Add(ListViewItem9)
  896.         Me.SatelliteList.Items.Add(ListViewItem10)
  897.         Me.SatelliteList.Items.Add(ListViewItem11)
  898.         Me.SatelliteList.Items.Add(ListViewItem12)
  899.         Me.SatelliteList.Items.Add(ListViewItem13)
  900.         Me.SatelliteList.Items.Add(ListViewItem14)
  901.         Me.SatelliteList.Items.Add(ListViewItem15)
  902.         Me.SatelliteList.Items.Add(ListViewItem16)
  903.         Me.SatelliteList.Location = New System.Drawing.Point(3, 21)
  904.         Me.SatelliteList.Size = New System.Drawing.Size(235, 198)
  905.         Me.SatelliteList.View = System.Windows.Forms.View.Details
  906.         '
  907.         'PRCColumn
  908.         '
  909.         Me.PRCColumn.Text = "PRC"
  910.         Me.PRCColumn.Width = 35
  911.         '
  912.         'AzimuthColumn
  913.         '
  914.         Me.AzimuthColumn.Text = "Azimuth"
  915.         Me.AzimuthColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
  916.         Me.AzimuthColumn.Width = 55
  917.         '
  918.         'ElevationColumn
  919.         '
  920.         Me.ElevationColumn.Text = "Elevation"
  921.         Me.ElevationColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
  922.         Me.ElevationColumn.Width = 56
  923.         '
  924.         'SignalColumn
  925.         '
  926.         Me.SignalColumn.Text = "Signal"
  927.         Me.SignalColumn.Width = 73
  928.         '
  929.         'RawDataTab
  930.         '
  931.         Me.RawDataTab.Controls.Add(Me.UnrecognizedSentences)
  932.         Me.RawDataTab.Controls.Add(Me.RecognizedSentences)
  933.         Me.RawDataTab.Controls.Add(Me.UnrecognizedSentencesLabel)
  934.         Me.RawDataTab.Controls.Add(Me.RecognizedSentencesLabel)
  935.         Me.RawDataTab.Location = New System.Drawing.Point(4, 4)
  936.         Me.RawDataTab.Size = New System.Drawing.Size(241, 220)
  937.         Me.RawDataTab.Text = "Data"
  938.         '
  939.         'UnrecognizedSentences
  940.         '
  941.         Me.UnrecognizedSentences.Location = New System.Drawing.Point(3, 174)
  942.         Me.UnrecognizedSentences.Size = New System.Drawing.Size(234, 44)
  943.         '
  944.         'RecognizedSentences
  945.         '
  946.         Me.RecognizedSentences.Location = New System.Drawing.Point(3, 21)
  947.         Me.RecognizedSentences.Size = New System.Drawing.Size(234, 128)
  948.         '
  949.         'UnrecognizedSentencesLabel
  950.         '
  951.         Me.UnrecognizedSentencesLabel.Location = New System.Drawing.Point(3, 156)
  952.         Me.UnrecognizedSentencesLabel.Size = New System.Drawing.Size(159, 18)
  953.         Me.UnrecognizedSentencesLabel.Text = "Unrecognized Sentences:"
  954.         '
  955.         'RecognizedSentencesLabel
  956.         '
  957.         Me.RecognizedSentencesLabel.Location = New System.Drawing.Point(3, 3)
  958.         Me.RecognizedSentencesLabel.Size = New System.Drawing.Size(138, 18)
  959.         Me.RecognizedSentencesLabel.Text = "Recognized Sentences:"
  960.         '
  961.         'Form1
  962.         '
  963.         Me.ClientSize = New System.Drawing.Size(249, 278)
  964.         Me.Controls.Add(Me.TabControl)
  965.         Me.Controls.Add(Me.StatusBar)
  966.         Me.Menu = Me.MainMenu
  967.         Me.Text = "GPS.NET Demo"
  968.  
  969.     End Sub
  970.  
  971. #End Region
  972.  
  973.     Private WithEvents GPS As New Receiver
  974.  
  975. #Region "  (Miscellaneous form code, does not include GPS demonstration code)  "
  976.  
  977.     ' Stores information about current activity going on with the GPS device
  978.     Public CurrentStatus As String
  979.  
  980.     ' Used to update the status bar
  981.     Public Sub UpdateStatusBar(ByVal sender As Object, ByVal e As EventArgs)
  982.         StatusBar.Text = CurrentStatus
  983.         ' Let the user interface update
  984.         System.Windows.Forms.Application.DoEvents()
  985.     End Sub
  986.  
  987.     ' Raised when the application is closing
  988.     Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
  989.         ' Shut down GPS communications
  990.         GPS.Stop()
  991.         ' Dispose of unmanaged resources
  992.         LocalTimeTimer.Dispose()
  993.         GPS.Dispose()
  994.     End Sub
  995.  
  996.     ' Raised when the form is first initialized
  997.     Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
  998.         ' Load in previsouly-saved serial port settings
  999.         ReadSettings()
  1000.         ' Override the font of the ListView (which cannot be set at design time!)
  1001.         SatelliteList.Font = New Font("Tahoma", 8, FontStyle.Regular)
  1002.     End Sub
  1003.  
  1004.     ' Raised when one of the Com ports menus is selected
  1005.     Private Sub MenuComPort_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuComPortAutomatic.Click, MenuComPort1.Click, MenuComPort2.Click, MenuComPort3.Click, MenuComPort4.Click, MenuComPort5.Click, MenuComPort6.Click, MenuComPort7.Click, MenuComPort8.Click
  1006.         ' Set the Com port to the fourth character of the menu, converted to an integer
  1007.         Dim SelectedMenuItem As MenuItem = sender
  1008.         If SelectedMenuItem.Text = "Automatic" Then
  1009.             GPS.Device.Settings.ComPort = ComPort.Automatic
  1010.         Else
  1011.             GPS.Device.Settings.ComPort = CType(SelectedMenuItem.Text.Substring(3), Integer)
  1012.         End If
  1013.         ' Save this setting
  1014.         SaveSettings()
  1015.         ' Update the checkboxes for each Com port menu item
  1016.         Dim MenuComPort As MenuItem
  1017.         For Each MenuComPort In SelectedMenuItem.Parent.MenuItems
  1018.             ' Check the item if its text matches that of the selected item
  1019.             MenuComPort.Checked = (MenuComPort.Text = SelectedMenuItem.Text)
  1020.         Next
  1021.     End Sub
  1022.  
  1023.     ' Raised when one of the baud rate menus is selected
  1024.     Private Sub MenuBaudRate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuBaudRateAutomatic.Click, MenuBaudRate4800.Click, MenuBaudRate9600.Click
  1025.         ' Set the Com port to the fourth character of the menu, converted to an integer
  1026.         Dim SelectedMenuItem As MenuItem = sender
  1027.         If SelectedMenuItem.Text = "Automatic" Then
  1028.             GPS.Device.Settings.BaudRate = BaudRate.Automatic
  1029.         Else
  1030.             GPS.Device.Settings.BaudRate = CType(SelectedMenuItem.Text, Integer)
  1031.         End If
  1032.         ' Save this setting
  1033.         SaveSettings()
  1034.         ' Update the checkboxes for each Com port menu item
  1035.         Dim MenuComPort As MenuItem
  1036.         For Each MenuComPort In SelectedMenuItem.Parent.MenuItems
  1037.             ' Check the item if its text matches that of the selected item
  1038.             MenuComPort.Checked = (MenuComPort.Text = SelectedMenuItem.Text)
  1039.         Next
  1040.     End Sub
  1041.  
  1042.     ' Raised when one of the parity menus is selected
  1043.     Private Sub MenuParity_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuParityNone.Click, MenuParityEven.Click, MenuParityOdd.Click, MenuParityMark.Click, MenuParitySpace.Click
  1044.         ' Set the Com port to the fourth character of the menu, converted to an integer
  1045.         Dim SelectedMenuItem As MenuItem = sender
  1046.         Select Case SelectedMenuItem.Text
  1047.             Case "None"
  1048.                 GPS.Device.Settings.Parity = Parity.None
  1049.             Case "Even"
  1050.                 GPS.Device.Settings.Parity = Parity.Even
  1051.             Case "Odd"
  1052.                 GPS.Device.Settings.Parity = Parity.Odd
  1053.             Case "Mark"
  1054.                 GPS.Device.Settings.Parity = Parity.Mark
  1055.             Case "Space"
  1056.                 GPS.Device.Settings.Parity = Parity.Space
  1057.         End Select
  1058.         ' Save this setting
  1059.         SaveSettings()
  1060.         ' Update the checkboxes for each Com port menu item
  1061.         Dim MenuParity As MenuItem
  1062.         For Each MenuParity In SelectedMenuItem.Parent.MenuItems
  1063.             ' Check the item if its text matches that of the selected item
  1064.             MenuParity.Checked = (MenuParity.Text = SelectedMenuItem.Text)
  1065.         Next
  1066.     End Sub
  1067.  
  1068.     ' Raised when one of the stop bit menus is selected
  1069.     Private Sub MenuStopBits_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuStopBits1.Click, MenuStopBits1_5.Click, MenuStopBits2.Click
  1070.         ' Set the Com port to the fourth character of the menu, converted to an integer
  1071.         Dim SelectedMenuItem As MenuItem = sender
  1072.         GPS.Device.Settings.StopBits = SelectedMenuItem.Text
  1073.         ' Save this setting
  1074.         SaveSettings()
  1075.         ' Update the checkboxes for each Com port menu item
  1076.         Dim MenuStopBits As MenuItem
  1077.         For Each MenuStopBits In SelectedMenuItem.Parent.MenuItems
  1078.             ' Check the item if its text matches that of the selected item
  1079.             MenuStopBits.Checked = (MenuStopBits.Text = SelectedMenuItem.Text)
  1080.         Next
  1081.     End Sub
  1082.  
  1083.     ' Raised when one of the data bit menus is selected
  1084.     Private Sub MenuDataBits_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuDataBits8.Click, MenuDataBits7.Click
  1085.         ' Set the Com port to the fourth character of the menu, converted to an integer
  1086.         Dim SelectedMenuItem As MenuItem = sender
  1087.         GPS.Device.Settings.DataBits = SelectedMenuItem.Text
  1088.         ' Save this setting
  1089.         SaveSettings()
  1090.         ' Update the checkboxes for each Com port menu item
  1091.         Dim MenuDataBits As MenuItem
  1092.         For Each MenuDataBits In SelectedMenuItem.Parent.MenuItems
  1093.             ' Check the item if its text matches that of the selected item
  1094.             MenuDataBits.Checked = (MenuDataBits.Text = SelectedMenuItem.Text)
  1095.         Next
  1096.     End Sub
  1097. #End Region
  1098.  
  1099. #Region "  Methods which load and save Com port settings to a file  "
  1100.  
  1101.     ' Reads previous serial port settings
  1102.     Private Sub ReadSettings()
  1103.         Try
  1104.             ' If a settings file does not exist, make one
  1105.             If Not System.IO.File.Exists("Settings.txt") Then SaveSettings()
  1106.             ' Read in the settings
  1107.             Dim SettingsFile As StreamReader = New StreamReader("Settings.txt")
  1108.             ' Read the serial port settings
  1109.             Dim Settings As String = SettingsFile.ReadLine
  1110.             ' Close the file
  1111.             SettingsFile.Close()
  1112.             ' Split the settings into an array
  1113.             Dim Values(4) As String
  1114.             Values = Settings.Split(",")
  1115.             ' And apply the settings
  1116.             GPS.Device.Settings.ComPort = Values(0)
  1117.             GPS.Device.Settings.BaudRate = Values(1)
  1118.             GPS.Device.Settings.DataBits = Values(2)
  1119.             GPS.Device.Settings.Parity = Values(3)
  1120.             GPS.Device.Settings.StopBits = Values(4)
  1121.             ' Check the appropriate Com port menu
  1122.             Select Case GPS.Device.Settings.ComPort
  1123.                 Case ComPort.Automatic
  1124.                     MenuComPortAutomatic.Checked = True
  1125.                 Case ComPort.COM1
  1126.                     MenuComPort1.Checked = True
  1127.                 Case ComPort.COM2
  1128.                     MenuComPort2.Checked = True
  1129.                 Case ComPort.COM3
  1130.                     MenuComPort3.Checked = True
  1131.                 Case ComPort.COM4
  1132.                     MenuComPort4.Checked = True
  1133.                 Case ComPort.COM5
  1134.                     MenuComPort5.Checked = True
  1135.                 Case ComPort.COM6
  1136.                     MenuComPort6.Checked = True
  1137.                 Case ComPort.COM7
  1138.                     MenuComPort7.Checked = True
  1139.                 Case ComPort.COM8
  1140.                     MenuComPort8.Checked = True
  1141.             End Select
  1142.             ' Check the appropriate baud rate menu
  1143.             Select Case GPS.Device.Settings.BaudRate
  1144.                 Case BaudRate.Automatic
  1145.                     MenuBaudRateAutomatic.Checked = True
  1146.                 Case BaudRate.Baud4800
  1147.                     MenuBaudRate4800.Checked = True
  1148.                 Case BaudRate.Baud9600
  1149.                     MenuBaudRate9600.Checked = True
  1150.             End Select
  1151.             ' Check the appropriate data bits menu
  1152.             Select Case GPS.Device.Settings.DataBits
  1153.                 Case DataBit.Size7
  1154.                     MenuDataBits7.Checked = True
  1155.                 Case DataBit.Size8
  1156.                     MenuDataBits8.Checked = True
  1157.             End Select
  1158.             ' Check the appropriate parity menu
  1159.             Select Case GPS.Device.Settings.Parity
  1160.                 Case Parity.Even
  1161.                     MenuParityEven.Checked = True
  1162.                 Case Parity.Mark
  1163.                     MenuParityMark.Checked = True
  1164.                 Case Parity.None
  1165.                     MenuParityNone.Checked = True
  1166.                 Case Parity.Odd
  1167.                     MenuParityOdd.Checked = True
  1168.                 Case Parity.Space
  1169.                     MenuParitySpace.Checked = True
  1170.             End Select
  1171.             ' Check the appropriate stop bit menu
  1172.             Select Case GPS.Device.Settings.StopBits
  1173.                 Case StopBit.Bit1
  1174.                     MenuStopBits1.Checked = True
  1175.                 Case StopBit.Bit1Point5
  1176.                     MenuStopBits1_5.Checked = True
  1177.                 Case StopBit.Bit2
  1178.                     MenuStopBits2.Checked = True
  1179.             End Select
  1180.         Catch ex As NullReferenceException
  1181.             ' This happens if the settings file is empty. Correct the file by rewriting it.
  1182.             SaveSettings()
  1183.         Catch ex As Exception
  1184.             ' File error (most likely, settings file does not exist)
  1185.             Throw ex
  1186.         End Try
  1187.     End Sub
  1188.  
  1189.     ' Writes the serial port settings to a little text file
  1190.     Private Sub SaveSettings()
  1191.         Dim SettingsFile As StreamWriter = New StreamWriter("Settings.txt")
  1192.         ' Write the serial port settings
  1193.         SettingsFile.WriteLine(CType(GPS.Device.Settings.ComPort, Integer) & "," _
  1194.            & CType(GPS.Device.Settings.BaudRate, Integer) & "," _
  1195.            & CType(GPS.Device.Settings.DataBits, Integer) & "," _
  1196.            & CType(GPS.Device.Settings.Parity, Integer) & "," _
  1197.            & CType(GPS.Device.Settings.StopBits, Integer))
  1198.         SettingsFile.Close()
  1199.     End Sub
  1200.  
  1201. #End Region
  1202.  
  1203. #Region "  Demonstration of Starting and Stopping GPS Communications  "
  1204.  
  1205.     ' Raised when the "Start" menu is clicked from the "GPS" menu
  1206.     Private Sub StartMenu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartMenu.Click
  1207.         Try
  1208.             ' Set the license key  (visit http://www.gpsdotnet.com/purchase for pricing and secure online ordering)
  1209.             ' GPS.SetLicenseKey("[your license key]")
  1210.  
  1211.             ' For speed, tell Automatic Device Discovery to use detected device 
  1212.             ' information from the registry.
  1213.             GPS.Device.DetectionMode = DeviceDetectionMode.UsePreviouslyDetectedDevices
  1214.             ' Uncomment the following line to perform detection once per session (slower, but recommended)
  1215.             'GPS.Device.DetectionMode = DeviceDetectionMode.DetectOncePerSession 
  1216.  
  1217.             ' Start GPS communications
  1218.             GPS.Start()
  1219.  
  1220.             ' Enable the disconnect menu
  1221.             StartMenu.Enabled = False
  1222.             StopMenu.Enabled = True
  1223.         Catch ex As GpsException
  1224.             MessageBox.Show(ex.Message, "Cannot Connect", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)
  1225.         Catch ex As Exception
  1226.             Stop
  1227.         End Try
  1228.     End Sub
  1229.  
  1230.     ' Raised when the "Stop" menu is clicked from the "GPS" menu
  1231.     Private Sub StopMenu_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles StopMenu.Click
  1232.         GPS.Stop()
  1233.         ' Re-enable the Start menu item
  1234.         StartMenu.Enabled = True
  1235.         StopMenu.Enabled = False
  1236.     End Sub
  1237.  
  1238.     ' Raised when a connection is being attempted
  1239.     Private Sub GPS_Connecting(ByVal sender As Object, ByVal e As DeviceSettingsEventArgs) Handles GPS.Connecting
  1240.         CurrentStatus = "Connecting to GPS device on " & e.DeviceSettings.ComPort.ToString
  1241.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1242.     End Sub
  1243.  
  1244.     ' Raised when a connection is being attempted
  1245.     Private Sub GPS_Connected(ByVal sender As Object, ByVal e As System.EventArgs) Handles GPS.Connected
  1246.         CurrentStatus = "Connected to GPS device, waiting for reply..."
  1247.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1248.     End Sub
  1249.  
  1250.     ' Raised when a connection is being attempted
  1251.     Private Sub GPS_Disconnecting(ByVal sender As Object, ByVal e As DeviceSettingsEventArgs) Handles GPS.Disconnecting
  1252.         CurrentStatus = "Disconnecting from GPS device on " & e.DeviceSettings.ComPort.ToString & "..."
  1253.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1254.     End Sub
  1255.  
  1256.     ' Raised when Communications with the GPS device were successfully stopped
  1257.     Private Sub GPS_Disconnected(ByVal sender As Object, ByVal e As System.EventArgs) Handles GPS.Disconnected
  1258.         ' The connection to the serial port has been closed
  1259.         CurrentStatus = "Disconnected from GPS device."
  1260.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1261.     End Sub
  1262. #End Region
  1263.  
  1264. #Region "  Demonstration of Raw Data Processing  "
  1265.  
  1266.     ' Stores information about the current sentence
  1267.     Private CurrentSentence As String
  1268.     ' Returns True if the sentence was fully understood
  1269.     Private CurrentSentenceType As SentenceType
  1270.  
  1271.     ' Adds the specified sentence to the list
  1272.     Private Sub AddSentence(ByVal sender As Object, ByVal e As EventArgs)
  1273.         Select Case CurrentSentenceType
  1274.             Case SentenceType.Recognized
  1275.                 ' The sentence was processed successfully
  1276.                 RecognizedSentences.Items.Add(CurrentSentence)
  1277.                 RecognizedSentences.SelectedIndex = RecognizedSentences.Items.Count - 1
  1278.                 ' Prevent too many lines from being in the list box
  1279.                 If RecognizedSentences.Items.Count > 20 Then RecognizedSentences.Items.RemoveAt(0)
  1280.             Case SentenceType.Unrecognized
  1281.                 ' The sentence contained some corrupt data, or was proprietary to a specific device
  1282.                 UnrecognizedSentences.Items.Add(CurrentSentence)
  1283.                 UnrecognizedSentences.SelectedIndex = UnrecognizedSentences.Items.Count - 1
  1284.                 ' Prevent too many lines from being in the list box
  1285.                 If UnrecognizedSentences.Items.Count > 20 Then UnrecognizedSentences.Items.RemoveAt(0)
  1286.         End Select
  1287.     End Sub
  1288.  
  1289.     ' Raised when a sentence has been received from the GPS device
  1290.     Private Sub GPS_SentenceReceived(ByVal sender As Object, ByVal e As SentenceEventArgs) Handles GPS.SentenceReceived
  1291.         CurrentSentence = e.Sentence
  1292.         CurrentSentenceType = e.Type
  1293.         ' Add the sentence to the appropriate ListBox in the "Data" tab
  1294.         Invoke(New EventHandler(AddressOf AddSentence))
  1295.     End Sub
  1296.  
  1297. #End Region
  1298.  
  1299. #Region "  Demonstration of Satellite-Related GPS Events  "
  1300.  
  1301.     ' Updates a satellite's information on the form
  1302.     Private Sub UpdateSatelliteCounts(ByVal sender As Object, ByVal e As EventArgs)
  1303.         ' The active count (the number of satellites reporting any information)
  1304.         ActiveSatellites.Text = GPS.Satellites.ActiveCount
  1305.         ' The tracked count (the number of satellites with a detectable signal)
  1306.         TrackedSatellites.Text = GPS.Satellites.TrackedCount
  1307.         ' The tracked count (the number of satellites being used to calculate your location)
  1308.         FixedSatellites.Text = GPS.Satellites.FixedCount
  1309.     End Sub
  1310.  
  1311.     ' Updates all satellite information
  1312.     Private Sub UpdateSatellites(ByVal sender As Object, ByVal e As EventArgs)
  1313.         Dim Satellite As Satellite
  1314.         ' Iterate through each known satellite
  1315.         For Each Satellite In GPS.Satellites
  1316.             ' And update its information
  1317.             UpdateSatellite(Satellite)
  1318.         Next
  1319.     End Sub
  1320.  
  1321.     ' Updates a satellite's information on the form
  1322.     Private Sub UpdateSatellite(ByVal Satellite As Satellite)
  1323.         ' Update the current satellite pseudo-random code
  1324.         SatelliteList.Items(Satellite.Index).Text = Satellite.PseudoRandomCode
  1325.         ' Update the current satellite elevation
  1326.         SatelliteList.Items(Satellite.Index).SubItems(1).Text = Satellite.Elevation.ToString
  1327.         ' Update the current satellite azimuth
  1328.         SatelliteList.Items(Satellite.Index).SubItems(2).Text = Satellite.Azimuth.ToString
  1329.         ' Update the signal strength for this satellite
  1330.         SatelliteList.Items(Satellite.Index).SubItems(3).Text = Satellite.SignalToNoiseRatio.ToString & " (" & Satellite.SignalToNoiseRatio.Rating.ToString & ")"
  1331.         ' Mark this item as checked if the satellite is involved in an active fix
  1332.         SatelliteList.Items(Satellite.Index).Checked = Satellite.IsFixObtained
  1333.     End Sub
  1334.  
  1335.     ' Raised when the horizontal angle (around the horizon) of a GPS satellite has changed
  1336.     Private Sub GPS_SatelliteAzimuthChanged(ByVal sender As Object, ByVal e As SatelliteEventArgs) Handles GPS.SatelliteAzimuthChanged
  1337.         ' Update the status to show that the azimuth has changed
  1338.         CurrentStatus = "Satellite " & e.Satellite.PseudoRandomCode & " azimuth has changed to " & e.Satellite.Elevation.ToString
  1339.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1340.         ' Update this satellite's information
  1341.         Invoke(New EventHandler(AddressOf UpdateSatellites))
  1342.     End Sub
  1343.  
  1344.     ' Raised when the vertical angle (up from the horizon) of a GPS satellite has changed
  1345.     Private Sub GPS_SatelliteElevationChanged(ByVal sender As Object, ByVal e As SatelliteEventArgs) Handles GPS.SatelliteElevationChanged
  1346.         ' Update the status to show that the elevation has changed
  1347.         CurrentStatus = "Satellite " & e.Satellite.PseudoRandomCode & " elevation has changed to " & e.Satellite.Elevation.ToString
  1348.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1349.         ' Update this satellite's information
  1350.         Invoke(New EventHandler(AddressOf UpdateSatellites))
  1351.     End Sub
  1352.  
  1353.     ' Raised when a satellite which previously was involved in a fix, has lost the fix
  1354.     Private Sub GPS_SatelliteFixLost(ByVal sender As Object, ByVal e As SatelliteEventArgs) Handles GPS.SatelliteFixLost
  1355.         ' Update this satellite's information
  1356.         Invoke(New EventHandler(AddressOf UpdateSatellites))
  1357.     End Sub
  1358.  
  1359.     ' Raised when a satellite is now being used to calculate your location
  1360.     Private Sub GPS_SatelliteFixObtained(ByVal sender As Object, ByVal e As SatelliteEventArgs) Handles GPS.SatelliteFixObtained
  1361.         ' Update this satellite's information
  1362.         Invoke(New EventHandler(AddressOf UpdateSatellites))
  1363.     End Sub
  1364.  
  1365.     ' Raised when the unique code for a satellite beComes known
  1366.     Private Sub GPS_SatellitePRCChanged(ByVal sender As Object, ByVal e As SatelliteEventArgs) Handles GPS.SatellitePseudoRandomCodeChanged
  1367.         ' Update this satellite's information
  1368.         Invoke(New EventHandler(AddressOf UpdateSatellites))
  1369.     End Sub
  1370.  
  1371.     ' Raised when the signal strength from a GPS satellite has changed
  1372.     Private Sub GPS_SatelliteSignalToNoiseRatioChanged(ByVal sender As Object, ByVal e As SatelliteEventArgs) Handles GPS.SatelliteSignalToNoiseRatioChanged
  1373.         ' Update the current status to show the change in signal strength
  1374.         CurrentStatus = "Satellite " & e.Satellite.PseudoRandomCode & " signal has changed to " & e.Satellite.SignalToNoiseRatio.ToString
  1375.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1376.         ' Update this satellite's information
  1377.         Invoke(New EventHandler(AddressOf UpdateSatellites))
  1378.     End Sub
  1379.  
  1380.     ' Handles three events: SatelliteActiveCountChanged, SatelliteFixCountChanged, SatelliteTrackedCountChanged
  1381.     Private Sub GPS_SatelliteCountChanged(ByVal sender As Object, ByVal e As SatelliteCountEventArgs) Handles GPS.SatelliteActiveCountChanged, GPS.SatelliteFixedCountChanged, GPS.SatelliteTrackedCountChanged
  1382.         ' Update the satellite counts
  1383.         Invoke(New EventHandler(AddressOf UpdateSatelliteCounts))
  1384.     End Sub
  1385. #End Region
  1386.  
  1387. #Region "  Demonstration of Motion-Related Events  "
  1388.  
  1389.     ' Updates the current speed
  1390.     Private Sub UpdateSpeed(ByVal sender As Object, ByVal e As EventArgs)
  1391.         ' NOTE: Change "ToStatuteMilesPerHour" to "ToKilometersPerHour" for non-USA measurements
  1392.         Speed.Text = GPS.Speed.ToStatuteMilesPerHour.ToString
  1393.     End Sub
  1394.  
  1395.     ' Updates the current altitude
  1396.     Private Sub UpdateAltitude(ByVal sender As Object, ByVal e As EventArgs)
  1397.         ' NOTE: Change "ToFeet" to "ToMeters" for non-USA measurements
  1398.         Altitude.Text = GPS.Altitude.ToFeet.ToString
  1399.     End Sub
  1400.  
  1401.     ' Updates the current bearing
  1402.     Private Sub UpdateBearing(ByVal sender As Object, ByVal e As EventArgs)
  1403.         ' Update the bearing
  1404.         Bearing.Text = GPS.Bearing.ToString
  1405.         ' And show the current bearing represented as a cardinal (Compass) direction
  1406.         Direction.Text = GPS.Bearing.CardinalDirection.ToString
  1407.     End Sub
  1408.  
  1409.     ' Updates the current location
  1410.     Private Sub UpdatePosition(ByVal sender As Object, ByVal e As EventArgs)
  1411.         ' Update the current latitude
  1412.         Latitude.Text = GPS.Position.Latitude.ToString
  1413.         ' Update the longitude
  1414.         Longitude.Text = GPS.Position.Longitude.ToString
  1415.     End Sub
  1416.  
  1417.     ' Updates the current magnetic variation
  1418.     Private Sub UpdateMagneticVariation(ByVal sender As Object, ByVal e As EventArgs)
  1419.         MagneticVariation.Text = GPS.MagneticVariation.ToString
  1420.     End Sub
  1421.  
  1422.     ' Raised when the current speed has changed
  1423.     Private Sub GPS_SpeedChanged(ByVal sender As Object, ByVal e As SpeedEventArgs) Handles GPS.SpeedChanged
  1424.         ' Update the status to show the change in speed
  1425.         CurrentStatus = "The current speed has changed to " & e.Speed.ToStatuteMilesPerHour.ToString
  1426.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1427.         ' Update the rate of travel
  1428.         Invoke(New EventHandler(AddressOf UpdateSpeed))
  1429.     End Sub
  1430.  
  1431.     ' Raised when the current altitude has changed
  1432.     Private Sub GPS_AltitudeChanged(ByVal sender As Object, ByVal e As DistanceEventArgs) Handles GPS.AltitudeChanged
  1433.         ' Change "ToFeet" to "ToMeters" for Metric measurements
  1434.         CurrentStatus = "Altitude has changed to " & e.Distance.ToFeet.ToString
  1435.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1436.         ' Update the current height above sea level
  1437.         Invoke(New EventHandler(AddressOf UpdateAltitude))
  1438.     End Sub
  1439.  
  1440.     ' Raised when the current direction of travel changes
  1441.     Private Sub GPS_BearingChanged(ByVal sender As Object, ByVal e As AzimuthEventArgs) Handles GPS.BearingChanged
  1442.         ' Display the cardinal direction with degree angle in parenthesis
  1443.         CurrentStatus = "Heading " & e.Azimuth.CardinalDirection.ToString & " (" & e.Azimuth.ToString & ")"
  1444.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1445.         ' Update the direction of travel
  1446.         Invoke(New EventHandler(AddressOf UpdateBearing))
  1447.     End Sub
  1448.  
  1449.     ' Raised when the current latitude or longitude has changed
  1450.     Private Sub GPS_PositionChanged(ByVal sender As Object, ByVal e As PositionEventArgs) Handles GPS.PositionChanged
  1451.         ' Set the status to show that the location has changed
  1452.         CurrentStatus = "Your current location has changed."
  1453.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1454.         ' Update the current location
  1455.         Invoke(New EventHandler(AddressOf UpdatePosition))
  1456.     End Sub
  1457.  
  1458.     ' Raised when the magnetic variation beComes known
  1459.     Private Sub GPS_MagneticVariationChanged(ByVal sender As Object, ByVal e As LongitudeEventArgs) Handles GPS.MagneticVariationChanged
  1460.         CurrentStatus = "Magnetic variation is now known."
  1461.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1462.         ' Update the current location
  1463.         Invoke(New EventHandler(AddressOf UpdateMagneticVariation))
  1464.     End Sub
  1465. #End Region
  1466.  
  1467. #Region "  Demonstration of Precision-Related Events  "
  1468.  
  1469.     ' Updates the form with dilution of precision (accuracy) information
  1470.     Private Sub UpdateMeanDilutionOfPrecision(ByVal sender As Object, ByVal e As EventArgs)
  1471.         ' Update the overall (mean) accuracy 
  1472.         MeanDilutionOfPrecision.Text = GPS.MeanDilutionOfPrecision.ToString
  1473.     End Sub
  1474.  
  1475.     ' Updates the form with dilution of precision (accuracy) information
  1476.     Private Sub UpdateHorizontalDilutionOfPrecision(ByVal sender As Object, ByVal e As EventArgs)
  1477.         ' Update the accuract of latitude/longitude measurements
  1478.         HorizontalDilutionOfPrecision.Text = GPS.HorizontalDilutionOfPrecision.ToString
  1479.     End Sub
  1480.  
  1481.     ' Updates the form with dilution of precision (accuracy) information
  1482.     Private Sub UpdateVerticalDilutionOfPrecision(ByVal sender As Object, ByVal e As EventArgs)
  1483.         ' Update the accuracy of altitude measurements
  1484.         VerticalDilutionOfPrecision.Text = GPS.VerticalDilutionOfPrecision.ToString
  1485.     End Sub
  1486.  
  1487.     ' Raised when the accuracy of latitude/longitude measurements has changed
  1488.     Private Sub GPS_HorizontalDilutionOfPrecisionChanged(ByVal sender As Object, ByVal e As DilutionOfPrecisionEventArgs) Handles GPS.HorizontalDilutionOfPrecisionChanged
  1489.         CurrentStatus = "Lat/long accuracy has changed to " & e.DilutionOfPrecision.ToString
  1490.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1491.         ' Update the accuracy information
  1492.         Invoke(New EventHandler(AddressOf UpdateHorizontalDilutionOfPrecision))
  1493.     End Sub
  1494.  
  1495.     ' Raised when the mean accuracy in the current latitude/longitude has changed
  1496.     Private Sub GPS_MeanDilutionOfPrecisionChanged(ByVal sender As Object, ByVal e As DilutionOfPrecisionEventArgs) Handles GPS.MeanDilutionOfPrecisionChanged
  1497.         CurrentStatus = "General accuracy has changed to " & e.DilutionOfPrecision.ToString
  1498.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1499.         ' Update the accuracy information
  1500.         Invoke(New EventHandler(AddressOf UpdateMeanDilutionOfPrecision))
  1501.     End Sub
  1502.  
  1503.     ' Raised when the confidence level of altitude measurements has changed
  1504.     Private Sub GPS_VerticalDilutionOfPrecisionChanged(ByVal sender As Object, ByVal e As DilutionOfPrecisionEventArgs) Handles GPS.VerticalDilutionOfPrecisionChanged
  1505.         CurrentStatus = "Altitude accuracy has changed to " & e.DilutionOfPrecision.ToString
  1506.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1507.         ' Update the accuracy information
  1508.         Invoke(New EventHandler(AddressOf UpdateVerticalDilutionOfPrecision))
  1509.     End Sub
  1510.  
  1511. #End Region
  1512.  
  1513. #Region "  Demonstration of Satellite Fix-Related Events  "
  1514.  
  1515.     ' Raised when a trilateration solution is no longer available
  1516.     Private Sub GPS_FixLost(ByVal sender As Object, ByVal e As System.EventArgs) Handles GPS.FixLost
  1517.         CurrentStatus = "The satellite fix has been lost."
  1518.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1519.     End Sub
  1520.  
  1521.     ' Raised when at least three satellites are able to calculate the current location
  1522.     Private Sub GPS_FixObtained(ByVal sender As Object, ByVal e As System.EventArgs) Handles GPS.FixObtained
  1523.         CurrentStatus = "A satellite fix has been acquired!"
  1524.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1525.     End Sub
  1526.  
  1527.     ' Raised when the fix changes from satellite-only to differential GPS (satellites plus ground stations)
  1528.     Private Sub GPS_FixQualityChanged(ByVal sender As Object, ByVal e As FixQualityEventArgs) Handles GPS.FixQualityChanged
  1529.         CurrentStatus = "The fix quality has changed."
  1530.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1531.     End Sub
  1532.  
  1533.     Private Sub GPS_FixMethodChanged(ByVal sender As Object, ByVal e As StormSource.Gps.FixMethodEventArgs) Handles GPS.FixMethodChanged
  1534.         CurrentStatus = "GPS fix method has changed to " & e.FixMethod.ToString
  1535.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1536.     End Sub
  1537.  
  1538.     Private Sub GPS_FixModeChanged(ByVal sender As Object, ByVal e As StormSource.Gps.FixModeEventArgs) Handles GPS.FixModeChanged
  1539.         CurrentStatus = "GPS fix mode has changed to " & e.FixMode.ToString
  1540.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1541.     End Sub
  1542. #End Region
  1543.  
  1544. #Region "  Demonstration of Handling GPS Errors  "
  1545.     ' Raised when an error has been encountered while trying to process GPS data
  1546.     Private Sub GPS_ErrorOccurred(ByVal sender As Object, ByVal e As ErrorEventArgs) Handles GPS.ErrorOccurred
  1547.         CurrentStatus = e.Exception.Message
  1548.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1549.     End Sub
  1550. #End Region
  1551.  
  1552. #Region "  Demonstration of Time-Related Events  "
  1553.  
  1554.     ' Updates the form with local date/time information
  1555.     Public Sub UpdateLocalTime(ByVal sender As Object, ByVal e As EventArgs)
  1556.         LocalTime.Text = Now.ToString
  1557.     End Sub
  1558.  
  1559.     ' Updates the form with local date/time information
  1560.     Public Sub UpdateGPSTime(ByVal sender As Object, ByVal e As EventArgs)
  1561.         UTCDateTime.Text = GPS.UtcDateTime.ToLocalTime.ToString
  1562.     End Sub
  1563.  
  1564.     ' Updates the local PocketPC time for Comparison to GPS satellite-based time
  1565.     Private Sub LocalTimeTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LocalTimeTimer.Tick
  1566.         Invoke(New EventHandler(AddressOf UpdateLocalTime))
  1567.     End Sub
  1568.  
  1569.     ' Raised when the date/time indicated by GPS satellites has changed
  1570.     Private Sub GPS_UTCDateTimeChanged(ByVal sender As Object, ByVal e As DateTimeEventArgs) Handles GPS.UtcDateTimeChanged
  1571.         Invoke(New EventHandler(AddressOf UpdateGPSTime))
  1572.     End Sub
  1573. #End Region
  1574.  
  1575. #Region "  Demonstration of Automatic Device Detection  "
  1576.  
  1577.     '  GPS.NET is able to search for and detect GPS devices connected to the device.
  1578.     '  This feature is recommended because it virtually removes the need to train your
  1579.     '  users on what serial ports are, and also removes the need to troubleshoot customers
  1580.     '  which do not know their correct serial port settings. 
  1581.     '
  1582.     '  To use device detection, set the Receiver.Device.Settings.ComPort property to
  1583.     '  ComPort.Automatic.  You can also use the DeviceSettingsDetector class to make your
  1584.     '  own device detection features.
  1585.  
  1586.     Private Sub GPS_DeviceDetectionStarted(ByVal sender As Object, ByVal e As System.EventArgs) Handles GPS.DeviceDetectionStarted
  1587.         ' Update the status to show that the azimuth has changed
  1588.         CurrentStatus = "Please wait, detecting GPS devices..."
  1589.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1590.     End Sub
  1591.  
  1592.     Private Sub GPS_DeviceDetectionCompleted(ByVal sender As Object, ByVal e As System.EventArgs) Handles GPS.DeviceDetectionCompleted
  1593.         ' Update the status to show that the azimuth has changed
  1594.         CurrentStatus = "GPS device detection has completed."
  1595.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1596.     End Sub
  1597.  
  1598.     Private Sub GPS_DeviceDetected(ByVal sender As Object, ByVal e As StormSource.Gps.DeviceSettingsEventArgs) Handles GPS.DeviceDetected
  1599.         ' Update the status to show that the azimuth has changed
  1600.         CurrentStatus = "A GPS device was found on " & e.DeviceSettings.ComPort.ToString & "!"
  1601.         Invoke(New EventHandler(AddressOf UpdateStatusBar))
  1602.     End Sub
  1603. #End Region
  1604.  
  1605. End Class
  1606.